package com.lq.mytool.strategy;

import com.alibaba.fastjson.JSON;
import com.lq.mytool.common.BaseBusinessException;
import com.lq.mytool.enums.AttendancePunchWayTypeEnum;
import com.lq.mytool.strategy.dto.PlacePunchWayDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

/**
 * <p>
 *
 * </p>
 *
 * @author Nydia
 * @menu
 * @since 2022/2/1
 */
@Component
public class PlacePunchWay implements PunchWayStrategy{
    @Override
    public void checkParam(String jsonPunchWay) {
        PlacePunchWayDTO dto = JSON.parseObject(jsonPunchWay,PlacePunchWayDTO.class);
        if (StringUtils.isEmpty(dto.getPlaceName())) {
            throw new BaseBusinessException(" 地址参数不能为空");
        }
    }

    @Override
    public AttendancePunchWayTypeEnum getPunchWayType() {
        return AttendancePunchWayTypeEnum.PLACE_PUNCH_WAYS;
    }

    @Override
    public <T> void getReturnParam() {

    }
}
